home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dc-0_2.lha / dc-0.2 / configure < prev    next >
Text File  |  1993-04-20  |  8KB  |  282 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. rm -f conftest*
  84. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  85.  
  86. # A filename unique to this package, relative to the directory that
  87. # configure is in, which we can look for to find out if srcdir is correct.
  88. unique_file=dc.texinfo
  89.  
  90. # Find the source files, if location was not specified.
  91. if test -z "$srcdir"; then
  92.   srcdirdefaulted=yes
  93.   # Try the directory containing this script, then `..'.
  94.   prog=$0
  95.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  96.   test "X$confdir" = "X$prog" && confdir=.
  97.   srcdir=$confdir
  98.   if test ! -r $srcdir/$unique_file; then
  99.     srcdir=..
  100.   fi
  101. fi
  102. if test ! -r $srcdir/$unique_file; then
  103.   if test x$srcdirdefaulted = xyes; then
  104.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  105.   else
  106.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  107.   fi
  108.   exit 1
  109. fi
  110. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  111. # But we can't avoid them for `..', to make subdirectories work.
  112. case $srcdir in
  113.   .|/*|~*) ;;
  114.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  115. esac
  116.  
  117. if test -z "$CC"; then
  118.   echo checking for gcc
  119.   saveifs="$IFS"; IFS="${IFS}:"
  120.   for dir in $PATH; do
  121.     test -z "$dir" && dir=.
  122.     if test -f $dir/gcc; then
  123.       CC="gcc"
  124.       break
  125.     fi
  126.   done
  127.   IFS="$saveifs"
  128. fi
  129. test -z "$CC" && CC="cc"
  130.  
  131. # Find out if we are using GNU C, under whatever name.
  132. cat > conftest.c <<EOF
  133. #ifdef __GNUC__
  134.   yes
  135. #endif
  136. EOF
  137. ${CC-cc} -E conftest.c > conftest.out 2>&1
  138. if egrep yes conftest.out >/dev/null 2>&1; then
  139.   GCC=1 # For later tests.
  140. fi
  141. rm -f conftest*
  142.  
  143. # Make sure to not get the incompatible SysV /etc/install and
  144. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  145. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  146. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  147. if test -z "$INSTALL"; then
  148.   echo checking for install
  149.   saveifs="$IFS"; IFS="${IFS}:"
  150.   for dir in $PATH; do
  151.     test -z "$dir" && dir=.
  152.     case $dir in
  153.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  154.     *)
  155.       if test -f $dir/installbsd; then
  156.     INSTALL="$dir/installbsd -c" # OSF1
  157.     INSTALL_PROGRAM='$(INSTALL)'
  158.     INSTALL_DATA='$(INSTALL) -m 644'
  159.     break
  160.       fi
  161.       if test -f $dir/install; then
  162.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  163.       : # AIX
  164.     else
  165.       INSTALL="$dir/install -c"
  166.       INSTALL_PROGRAM='$(INSTALL)'
  167.       INSTALL_DATA='$(INSTALL) -m 644'
  168.       break
  169.     fi
  170.       fi
  171.       ;;
  172.     esac
  173.   done
  174.   IFS="$saveifs"
  175. fi
  176. INSTALL=${INSTALL-cp}
  177. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  178. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  179.  
  180. for func in bcopy bzero
  181. do
  182. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  183. echo checking for ${func}
  184. cat > conftest.c <<EOF
  185. #include <stdio.h>
  186. int main() { exit(0); } 
  187. int t() { 
  188. #ifdef __stub_${func}
  189. choke me
  190. #else
  191. /* Override any gcc2 internal prototype to avoid an error.  */
  192. extern char ${func}(); ${func}();
  193. #endif
  194.  }
  195. EOF
  196. if eval $compile; then
  197.   {
  198. test -n "$verbose" && \
  199. echo '    defining' ${trfunc}
  200. DEFS="$DEFS -D${trfunc}=1"
  201. }
  202.  
  203. fi
  204. rm -f conftest*
  205. #endif
  206. done
  207.  
  208. if test -n "$prefix"; then
  209.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  210.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  211. fi
  212. if test -n "$exec_prefix"; then
  213.   prsub="$prsub
  214. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  215. exec_prefix\\1=\\2$exec_prefix%"
  216. fi
  217.  
  218. trap 'rm -f config.status; exit 1' 1 3 15
  219. echo creating config.status
  220. rm -f config.status
  221. cat > config.status <<EOF
  222. #!/bin/sh
  223. # Generated automatically by configure.
  224. # Run this file to recreate the current configuration.
  225. # This directory was configured as follows,
  226. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  227. #
  228. # $0 $*
  229.  
  230. for arg
  231. do
  232.   case "\$arg" in
  233.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  234.     exec /bin/sh $0 $* ;;
  235.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  236.   esac
  237. done
  238.  
  239. trap 'rm -f Makefile; exit 1' 1 3 15
  240. CC='$CC'
  241. INSTALL='$INSTALL'
  242. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  243. INSTALL_DATA='$INSTALL_DATA'
  244. LIBS='$LIBS'
  245. srcdir='$srcdir'
  246. DEFS='$DEFS'
  247. prefix='$prefix'
  248. exec_prefix='$exec_prefix'
  249. prsub='$prsub'
  250. EOF
  251. cat >> config.status <<\EOF
  252.  
  253. top_srcdir=$srcdir
  254. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  255.   srcdir=$top_srcdir
  256.   # Remove last slash and all that follows it.  Not all systems have dirname.
  257.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  258.   if test "$dir" != "$file"; then
  259.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  260.     test ! -d $dir && mkdir $dir
  261.   fi
  262.   echo creating $file
  263.   rm -f $file
  264.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  265.   sed -e "
  266. $prsub
  267. s%@CC@%$CC%g
  268. s%@INSTALL@%$INSTALL%g
  269. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  270. s%@INSTALL_DATA@%$INSTALL_DATA%g
  271. s%@LIBS@%$LIBS%g
  272. s%@srcdir@%$srcdir%g
  273. s%@DEFS@%$DEFS%
  274. " $top_srcdir/${file}.in >> $file
  275. fi; done
  276.  
  277. exit 0
  278. EOF
  279. chmod +x config.status
  280. test -n "$no_create" || ./config.status
  281.  
  282.